﻿using System;

namespace _19_委托实例如何绑定方法
{
    class Program
    {
        static void Main(string[] args)
        {

            //绑定委托
            Dosomthing dele = new Dosomthing(RunHere);

            //简化写法：
            //Dosomthing dele = RunHere;

            //调用委托
            double res=dele(16,27.67d);
            Console.WriteLine("调用结果：{0}", res);
            Console.Read();
        }

        static double RunHere(int a,double b)
        {
            return a + b;
        }
    }

    //委托一个实例
     delegate double Dosomthing(int x, double y);

}
